<?php

class TkView
{

    public $errors;
    public $messages;
    private $file = 'index.phtml';

    public function render()
    {
        include 'index.phtml';
    }

    public function renderErrors()
    {
        if (!empty($this->errors))
        {
            echo '<div class="error-message">' . implode('<br />', $this->errors) . '</div>';
        }
    }

    public function renderMessages()
    {
        if (!empty($this->messages))
        {
            echo '<div class="success-message">' . implode('<br />', $this->messages) . '</div>';
        }
    }
}